feat(checks): normalize check options to alway be an object #2219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ensured check options is always an object and normalized any non-objects to be
{ value: param }
. Also ensured each check was passed a merged result of the check default options and any passed in options so that you didn't need to pass all options in just to override one of them.Created a
testUtils
helper utility that also merges the options and calls the evaluate method. This will also allow us to not have to pass in default check options for tests in #2216 and #2215 (simplifying those greatly). Since the evaluate methods are never called directly but instead throughcheck.run
, having a wrapper to call that does the options merging is actually more closely tied to how we call the API.I also updated all check tests to use the new function (simple find and replace).
The important files (not find/replaced):
Closes issue: #2191
Reviewer checks
Required fields, to be filled out by PR reviewer(s)